<link rel="stylesheet" href="<?php echo URL::base() ?>media/vendor/css/style.css" type="text/css" media="all" />
<link rel="stylesheet" href="<?php echo URL::base() ?>media/vendor/artdialog/skins/default.css" type="text/css" media="all" />
<link href="<?php echo URL::base() ?>media/vendor/css/ui-lightness/jquery-ui-1.10.4.custom.css" rel="stylesheet">
<script src="<?php echo URL::base() ?>media/vendor/js/jquery-1.10.2.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery-ui-1.10.4.custom.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery.ui.datepicker-zh-TW.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/Validform_v5.3.2_ncr_min.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/artdialog/jquery.artDialog.js"></script>
<style>
.mypage{display: none;}
 .info span{
  display:inline-block;
   width: 15px;
   height: 15px;
  }
 .yellow{background-color: yellow;}
 .green{background-color: green;}
 .red{background-color: red;}
 .table1 thead tr th,.table1 tbody tr td{ text-align:center;}
 .red,.yellow,.green{ margin-right:5px; margin-left:10px;}
 .form-horizontal .control-label{ width:80px;}
.form-horizontal .controls{margin-left: 90px;}

</style>
<script type="text/javascript">
$(document).ready(function(){
	$('.table1 > tbody > tr:odd').css("background-color","#f5f5f5");
})
</script>
<script type="text/javascript">
url='';
function get_pandian(url){
	var dialog = art.dialog({title: '提示',icon:'question',lock: true});
	dialog.content('<p>数据查询中,请稍后...<p>');
	$.get(
    	    url,
    	    {
    	    	name: $("input[name='name']").val(),
    	    	sku: $("input[name='sku']").val(),
                status:$("select[name='status']").val(),
    	    	start_time: $("input[name='start_time']").val(),
	    	    end_time: $("input[name='end_time']").val(),
	    	 },
	    	  function(data){
	    	    	$('#table_content').empty();
	    	    	$('#table_content').html(data);
	    	    	$('#pager_links').empty();
	    	        $('.mypage').clone().appendTo('#pager_links').show();
 	    		dialog.close();
	   	   }
    	 );
}
$(function() {
	$.datepicker.setDefaults({ dateFormat: 'yy-mm-dd' });
	$("#start").datepicker({  
	    onSelect:function(dateText,inst){  
	       $("#end").datepicker("option","minDate",dateText);  
	    }  
	});  
	$("#end").datepicker({  
	    onSelect:function(dateText,inst){  
	        $("#start").datepicker("option","maxDate",dateText);  
	    }  
	});  
	
	$("#search").click(function(){
	    url='<?php echo URL::base() ?>inventory/pandian/pandian_searchto';
		get_pandian(url);
	});
	  $(document).on('click', '.pagination a', function(e){
	  	  e.preventDefault(); 
	        url =$(this).attr('href');
	        if(url.length){
	        	get_pandian(url);
	        }
	        
	     });
});
</script>
<style>
.table1 thead tr th{ border:1px solid #ffffff;}
</style>
<div class="row">
		<div class="span11">
			<form class="form-horizontal upSuppForm" >
				<div class="control-group">
    	      		<label class="control-label w-label">盘点人:</label>
					<div class="controls">
					<input type="text"  style=" width:164px;" value=""  name="name"  class="inputxt"  />
					 
					</div>
				</div>
				<div class="control-group">
    	      		<label class="control-label w-label">SKU:</label>
					<div class="controls">
					<input type="text"  style=" width:164px;" value=""  name="sku"  class="inputxt"  />
					</div>
				</div>
				<div class="control-group">
    	      		<label class="control-label w-label">类型:</label>
					<div class="controls">
					<select name="status"   style=" width:178px;">
					  <option value="">全部</option>
					  <option value="1">盘亏</option>
					  <option value="2">盘盈</option>
					  <option value="3">库存无出入</option>
					</select>
					</div>
				</div>
				<div class="control-group">
    	      		<label class="control-label w-label">盘点时间:</label>
					<div class="controls">
						 <input type="text" style=" width:164px;" name='start_time' class=" datepicker" id="start" readonly="readonly"> ~
						<input type="text" style=" width:164px;" name='end_time' class="datepicker" id="end" readonly="readonly">
						 <div style=" margin-left:10px;" class="btn btn-info" id="search">查询</div>
					</div>
					
				</div>
			</form>
			 <table class="table table1 table-bordered" style="border-collapse:collapse;">
              <thead>
                <tr style="background-color:#4EA392; font-weight:bold; color:#ffffff;">
                  <th>SKU</th>
                  <th>中文名称</th>
                  <th>储位</th>
                  <th style="width:90px;">盘点时间</th>
                  <th>单据下载时间</th>
                  <th>单据上传时间</th>
                  <th>类型</th>
                  <th>下载单据时的系统实际库存数量</th>
                  <th>上传单据时的系统实际库存数量</th>
                  <th>盘点量</th>
                  <th>差异量</th>
                  <th>盘点人</th>
                </tr>
              </thead>
              <tbody id='table_content'>
              </tbody>
            </table>
            <div class="info" style=" margin-bottom:10px;">
				<span class="red"></span>红色代表盘亏数量
				<span class="green"></span>绿色代表盘赢数量
				<span class="yellow"></span>黄色代表上传单据时的系统实际库存数量和下载单据时的系统实际库存数量不一致，说明期间有出入库记录。
			</div>

           <div id="pager_links"></div>
		</div>
		<div class="span2"></div>
	</div>
